package com.audaque.springboot.foshanupload.security.listener;

import com.audaque.springboot.foshanupload.authcore.model.currentUser.TransmittableThreadLocalCurrentUser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.session.events.SessionCreatedEvent;
import org.springframework.stereotype.Component;

/**
 * @author zgb
 * @desc ...
 * @date 2022-08-21 21:17:45
 */

/**
 * session事件监听器
 *
 * @author zgb
 */
@Slf4j
@Component
public class SecuritySessionCreatedEventListener implements ApplicationListener<SessionCreatedEvent> {


    @Override
    public void onApplicationEvent(SessionCreatedEvent event) {
        log.debug("SessionCreatedEvent");
        TransmittableThreadLocalCurrentUser transmittableThreadLocalCurrentUser = TransmittableThreadLocalCurrentUser.getCurrentUser();
        log.debug("transmittableThreadLocalCurrentUser :"+transmittableThreadLocalCurrentUser);

    }
}
